Syntax errors on first execution?

I have fairly large DXL script (a few thousand lines, total) and I'm trying to make one of the dialogs it creates modal (by switching from "show" to "block", etc.). I've noticed that the first time it executes it has hundreds of syntax errors (it appears to be each time the DB variable is accessed?). Each time after that it works though. In order to recreate the problem I have to close DOORS and start it up again.

I've come up with a small example that exhibits the same problem...

DB _a_dialog
 
void close_a_dialog(DB unused) {
    release(_a_dialog)
}
 
void make_a_dialog() {
        _a_dialog = create("A dialog", styleCentered)
        
        close(_a_dialog, false, close_a_dialog)
        
        block(_a_dialog)
        destroy(_a_dialog)
}
 
make_a_dialog()

 


The first time I run that, I get the following syntax errors...

 

 

-E- DXL: <Line:1> syntax error
-E- DXL: <Line:8> syntax error
-E- DXL: <Line:10> syntax error
-I- DXL: all done with 3 errors and 0 warnings


...and each time after that it works perfectly, until I close and reopen DOORS, and run it again.

Any ideas?

 


Thursday1036PM - Fri Jun 17 11:30:58 EDT 2011

Re: Syntax errors on first execution?
llandale - Fri Jun 17 16:12:58 EDT 2011

Variable names must start with a letter as per the manual Introduction>Lexical conventions>Identifiers. "_a_dialog" starts with an underscore.

Mathias has some explanation why your underscored name causes problems the first time but not others but I don't recall why, but it doesn't matter. Rename your DB.

  • Louie

Re: Syntax errors on first execution?
Thursday1036PM - Fri Jun 17 16:33:54 EDT 2011

llandale - Fri Jun 17 16:12:58 EDT 2011
Variable names must start with a letter as per the manual Introduction>Lexical conventions>Identifiers. "_a_dialog" starts with an underscore.

Mathias has some explanation why your underscored name causes problems the first time but not others but I don't recall why, but it doesn't matter. Rename your DB.

  • Louie

Wow, that fixed it! What a weird way for a bug to present itself (worked fine with "show", but not "block").

Thanks a bunch!

Re: Syntax errors on first execution?
llandale - Fri Jun 17 16:57:01 EDT 2011

Thursday1036PM - Fri Jun 17 16:33:54 EDT 2011
Wow, that fixed it! What a weird way for a bug to present itself (worked fine with "show", but not "block").

Thanks a bunch!

Unlikely it worked with 'show' since it gives the error the on the very first line.

Re: Syntax errors on first execution?
Thursday1036PM - Sun Jun 19 16:56:12 EDT 2011

llandale - Fri Jun 17 16:57:01 EDT 2011
Unlikely it worked with 'show' since it gives the error the on the very first line.

Oh, you're right. I changed that off the bat and had other errors at first, one of which was probably the first execution ones. I fooled myself.

Thanks a bunch!